<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/rp/common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
  	
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    
    <title>系统登录</title>
	
	<link href="rp/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	
	<style type="text/css">
	   	body {
		  padding-top: 40px;
		  padding-bottom: 40px;
		  background-color: #66CCFF;
		}
		
		.form-signin {
		  max-width: 370px;
		  padding: 15px;
		  margin: 0 auto;
		}
		.form-signin .form-signin-heading,
		.form-signin .checkbox {
		  margin-bottom: 10px;
		  color: #FFF;
		}
		.form-signin .checkbox {
		  font-weight: normal;
		}
		.form-signin .form-control {
		  position: relative;
		  height: auto;
		  -webkit-box-sizing: border-box;
		     -moz-box-sizing: border-box;
		          box-sizing: border-box;
		  padding: 10px;
		  font-size: 16px;
		}
		.form-signin .form-control:focus {
		  z-index: 2;
		}
		.form-signin input[type="text"] {
		  margin-bottom: -1px;
		  border-bottom-right-radius: 0;
		  border-bottom-left-radius: 0;
		}
		.form-signin input[type="password"] {
		  margin-bottom: 10px;
		  border-top-left-radius: 0;
		  border-top-right-radius: 0;
		}
		
		#cloud {
		    background: url("rp/common/404/images/error_cloud.png") repeat-x scroll 0 0 transparent;
		    bottom: 0;
		    height: 170px;
		    position: absolute;
		    width: 100%;
		}
    </style>
	
  </head>
  
  <body>
  	<!-- <input type="hidden" id="errorMessage" value="${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}"/> -->
  	
  	<div class="container">
	  
      <form id="loginForm" action="rp/doLogin" class="form-signin" method="post">
      	<input type="hidden" name="secretKey" value="324014DA368E35A3937A4063FB8863AC"/>
      	<c:if test="${ !empty errorMsg }">
	      	<div id="errorMsg" class="alert alert-danger" style="padding: 8px;">
		  		<span>${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}</span>
		  	</div>
      	</c:if>
        <h2 class="form-signin-heading">欢迎访问RaptorPlatform2</h2>
        <label for="username" class="sr-only">用户名</label>
        <input type="text" id="username" name="j_username" class="form-control" 
        	placeholder="请输入用户名" value="administrator" required autofocus>
        <label for="password" class="sr-only">密码</label>
        <input type="password" id="password" name="j_password" class="form-control" 
        	placeholder="请输入密码" value="888888" required>
        <!-- <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> 记住我
          </label>
        </div> -->
        <div class="btn-group btn-group-lg" style="width: 100%;">
        	<button class="btn btn-lg btn-primary" type="submit" style="width: 70%;">登 录</button>
        	<button class="btn btn-lg btn-danger" type="button" style="width: 30%;" onclick="openRegisterPage()">注 册</button>
        </div>
        
      </form>
	  
    </div>
    
    <div id="cloud"></div>
    
    <script src="rp/scripts/jquery-1.8.3.min.js"></script>
    <script src="rp/scripts/lhgdialog/lhgdialog.min.js?self=false&skin=idialog"></script>
    
	<script type="text/javascript">
		
		$(function(){
			
		});
		
		function openRegisterPage(){
			$.dialog({
				title: "用户注册",
				width: "380px",
			    height: "450px",
			    max: false,
			    min: false,
				content: "url:rp/register.jsp"
			});
		}
		
	</script>
  </body>
</html>
